<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>
	Package Stores
</title>

<link rel="stylesheet" href="Doc.css" />

</head>

<body id="DocTopic">

<div class="TopicHeader">
	<div class="Supertitle_">
		Microsoft Learning Components
	</div>
	Package Stores
</div>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<div class="Summary">

<p>In order to execute an e-learning package (i.e. create a
<a href="MlcSessions.htm#StoredLearningSession">StoredLearningSession</a> onto it), Microsoft
Learning Components needs to <b>register</b> the package.  This process involves copying
information from the package's manifest into various database tables for fast subsequent lookup.
In the process, the package is assigned a
<a href="Microsoft.LearningComponents.Storage.PackageItemIdentifier.Class.htm">PackageItemIdentifier</a>, a 64-bit integer identifier that's
unique within the <a href="MlcLearningStore.htm">LearningStore</a> database.</p>

<p>However, other than copying information from the package manifest, MLC doesn't store the
contents of a package when it's registered.  Instead, MLC stores a <i>location string</i> which is
used to locate the package as needed.  What's contained in the location string?  It depends on
where the application has decided to store its packages.  The way the application tells MLC how to
map a package identifier to package contents is by providing MLC with a <b>package store</b>.</p>

<p>A package store is an instance of a class derived from
<a href="Microsoft.LearningComponents.Storage.PackageStore.Class.htm">PackageStore</a>.  MLC
implements the following package store types:</p>

<table class="Grid" style="width: auto">
	<col class="Column1_" />
	<col class="Column2_" />
	<tr class="Header_">
		<td class="Header1_">Package Store Class</td>
		<td class="Header2_">Description</td>
		<td class="Header3_">Location String Format</td>
	</tr>
	<tr>
		<td>
			<a href="Microsoft.LearningComponents.Storage.FileSystemPackageStore.Class.htm">FileSystemPackageStore</a>
		</td>
		<td>
			When the application asks FileSystemPackageStore to register a package,
			FileSystemPackageStore copies the contents of the package, "unzipped", into a new
			subdirectory of an application-specified directory, and updates the
			<a href="Microsoft.SharePointLearningKit.Schema.PackageItem.Class.htm">PackageItem</a>
			database table (and related table) with information about the package, including the
			name of the new subdirectory.
		</td>
		<td>
			The location string is the name of the subdirectory (within the application-specified
			package store directory) containing the copy of the package.  The subdirectory name is
			chosen by FileSystemPackageStore.
		</td>
	</tr>
	<tr>
		<td>
			<a href="Microsoft.LearningComponents.SharePoint.SharePointPackageStore.Class.htm">SharePointPackageStore</a>
		</td>
		<td>
			When the application asks SharePointPackageStore to register a package, the package
			must already be stored within a document library in SharePoint.
			SharePointPackageStore updates the
			<a href="Microsoft.SharePointLearningKit.Schema.PackageItem.Class.htm">PackageItem</a>
			database table (and related table) so that it contains a reference to the package in
			the document library.
		</td>
		<td>
			The location string contains five substrings, separated by underscores.  The substrings
			contain the same information maintained by the
			<a href="Microsoft.LearningComponents.SharePoint.SharePointFileLocation.Class.htm">SharePointFileLocation class</a>.
		</td>
	</tr>
</table>

<p>FileSystemPackageStore is useful for applications that want to implement playback of e-learning
content that's not stored in SharePoint.  For example,
<a href="file://C:\dev\SLK\SdkDoc\Pages\MlcBasicWebPlayer.htm">BasicWebPlayer</a> (MLC sample code) uses
FileSystemPackageStore to store files uploaded to it.</p>

<p>SharePointPackageStore is used by applications that store e-learning content in SharePoint.
(It should not be a surprise that <a href="Default.htm">SharePoint Learning Kit</a> uses
SharePointPackageReader.) Although SharePointPackageStore does not store the master copy of a
package, it does maintain a cached copy of the package&mdash;cached in a file system directory
specified by the application&mdash;to improve performance.  (Otherwise, each time any file within
a package needed to be read, the package would need to be retrieved from SharePoint's database and
"unzipped".) SharePoint's package cache can be controlled using
<a href="Microsoft.LearningComponents.SharePoint.SharePointCacheSettings.Class.htm">SharePointCacheSettings</a>,
passed as a parameter to the
<a href="Microsoft.LearningComponents.SharePoint.SharePointPackageStore.SharePointPackageStore.Method.htm">SharePointPackageStore</a> constructor.</p>

<p>In addition to using the package store types listed above, an application can create a custom
package store implementation, by creating a class based on
<a href="Microsoft.LearningComponents.Storage.PackageStore.Class.htm">PackageStore</a>.</p>

</div>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<div class="SectionHeader">For More Information</div>
<div class="Section">

<div><a href="Microsoft.LearningComponents.Storage.PackageStore.Class.htm">PackageStore Class (API Reference)</a></div>
<div><a href="Microsoft.LearningComponents.Storage.FileSystemPackageStore.Class.htm">FileSystemPackageStore Class (API Reference)</a></div>
<div><a href="Microsoft.LearningComponents.SharePoint.SharePointPackageStore.Class.htm">SharePointPackageStore Class (API Reference)</a></div>

</div>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<div class="SectionHeader"></div>
<div class="Section">
<b><a href="MlcFrameset.htm">Next Topic: MLC Session Frameset</a></b>
</div>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<div class="TopicFooter">
</div>

<div class="PageFooter">
Copyright &copy; Microsoft Corporation.&nbsp; All rights reserved.
</div>

</body>

</html>

